package com.ydlclass.loadbalancer.LoadBalanceImpl;

import com.ydlclass.YrpcBootstrap;
import com.ydlclass.discovery.Registry;
import com.ydlclass.exceptions.CreatLoadBalanceException;
import com.ydlclass.loadbalancer.AbstractLoadBalance;
import com.ydlclass.loadbalancer.LoadBalance;
import com.ydlclass.loadbalancer.Selector;
import com.ydlclass.loadbalancer.SelectorImpl.RoundRobinSelector;
import lombok.extern.slf4j.Slf4j;

import java.net.InetSocketAddress;
import java.util.List;

/**
 * 负载均衡器--轮询的负载均衡器
 * @Author duWenJian
 * @Date 2024/2/25 16:56
 * @Version 1.0
 */
@Slf4j
public class RoundRobinLoadBalancer extends AbstractLoadBalance {
    @Override
    protected Selector getSelector(List<InetSocketAddress> socketAddressList) {
        Selector selector = new RoundRobinSelector(socketAddressList);
        return selector;
    }
}
